﻿using D20.Entities.Characters;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace D20.UnitTests.Characters
{
    
    
    /// <summary>
    ///This is a test class for SkillTest and is intended
    ///to contain all SkillTest Unit Tests
    ///</summary>
    [TestClass()]
    public class SkillTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for SkillType
        ///</summary>
        [TestMethod()]
        public void SkillTypeTest()
        {
            Skill target = new Skill(); // TODO: Initialize to an appropriate value
            SkillType expected = SkillType.Listen;
            SkillType actual;
            target.SkillType = expected;
            actual = target.SkillType;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Proficiency
        ///</summary>
        [TestMethod()]
        public void ProficiencyTest()
        {
            Skill target = new Skill(SkillType.Search, 1);
            int expected = 2;
            int actual;
            target.Proficiency = expected;
            actual = target.Proficiency;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for op_Inequality
        ///</summary>
        [TestMethod()]
        public void op_InequalityTest()
        {
            Skill left = new Skill(SkillType.Search, 1);
            Skill right = new Skill(SkillType.Search, 12);
            bool expected = true; 
            bool actual;
            actual = (left != right);
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for op_Equality
        ///</summary>
        [TestMethod()]
        public void op_EqualityTest()
        {
            Skill left = new Skill(SkillType.Search, 1);
            Skill right = new Skill(SkillType.Search, 1);
            bool expected = true; 
            bool actual;
            actual = (left == right);
            Assert.AreEqual(expected, actual);
        }


        /// <summary>
        ///A test for Equals
        ///</summary>
        [TestMethod()]
        public void EqualsTest()
        {
            Skill target = new Skill(SkillType.Search, 123);
            object skillObject = new Skill(SkillType.Search, 123);
            bool expected = true;
            bool actual;
            actual = target.Equals(skillObject);
            Assert.AreEqual(expected, actual);
            Skill s = (Skill)skillObject;
            s.Proficiency = 21;
            skillObject = s;
            expected = false;
            actual = target.Equals(skillObject);
            Assert.AreEqual(expected, actual);
            skillObject = 123;
            actual = target.Equals(skillObject);
            Assert.AreEqual(expected, actual);
        }
    }
}
